package Day1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = {"/demoe"})
//"/","*"任意匹配
//*.do /aaa.do 扩展名匹配
//目录匹配/user/*
// 用/*
public class Text extends HttpServlet {
//response 设置响应数据 request获取请求数据
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //试在服务器端设置响应头的编码格式
        resp.setContentType("text/html;charset=utf-8");
        resp.getWriter().write("啊大苏打");
    }
}
